﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace Z13qu.Data
{
    public class DbContextFactory
    {
        public static KoalaDbContext DbContext()
        {
            KoalaDbContext dbContext = HttpContext.Current.Items["dbContext"] as KoalaDbContext;
            if (dbContext == null)
            {
                dbContext = new KoalaDbContext();
                HttpContext.Current.Items["dbContext"] = dbContext;
            }
            return dbContext;
        }
    }
}
